<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="js/vue.js"></script>
</head>
<body>
<a href="index.html">返回</a>
<div class="app">
    <h2>计算属性：</h2>
    <input type="text" v-model="name">
    <input type="text" v-model="age">
    {{info}}
</div>
<script>
    Vue.config.productionTip=false  //关闭生产状态提示
    const x=new Vue({
        data:function (){
            return{
                name:"老杨",
                age:20
            }
        },
        computed:{
            info(){
                return this.name+'-'+this.age
            }
        }
    })
        x.$mount(".app")//挂载方式
</script>
</body>
</html>